.class public Lcom/opongo/blogapp/adapter/PostListAdapter;
.super Landroid/widget/SimpleCursorAdapter;
.source "PostListAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;
    }
.end annotation


# static fields
.field public static final DEBUG:Z

.field protected static final IDS:[I

.field protected static final POSTCOLUMNS:[Ljava/lang/String;

.field private static final TAG:Ljava/lang/String;


# instance fields
.field private activity:Landroid/app/Activity;

.field private categoriesIndex:I

.field private commentscountIndex:I

.field private dateIndex:I

.field private df:Ljava/text/DateFormat;

.field private footerView:Landroid/view/View;

.field private headerView:Landroid/view/View;

.field private idIndex:I

.field private imageManager:Lcom/opongo/blogapp/manager/ImageManager;

.field private imageurlIndex:I

.field public isLockLoading:Z

.field public lastpage:Z

.field public lastrefresh:J

.field private layoutId:I

.field public listView:Landroid/widget/ListView;

.field private mInflater:Landroid/view/LayoutInflater;

.field private opened:I

.field private pTime:Lcom/ocpsoft/pretty/time/PrettyTime;

.field public page:I

.field public posts:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/opongo/blogapp/common/Post;",
            ">;"
        }
    .end annotation
.end field

.field private tablename:Ljava/lang/String;

.field private titleIndex:I


# direct methods
.method static constructor <clinit>()V
    .locals 4

    .prologue
    const/4 v3, 0x4

    .line 44
    sget-boolean v0, Lcom/opongo/blogapp/AbaSettings;->DEBUG:Z

    sput-boolean v0, Lcom/opongo/blogapp/adapter/PostListAdapter;->DEBUG:Z

    .line 45
    const-class v0, Lcom/opongo/blogapp/adapter/PostListAdapter;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/opongo/blogapp/adapter/PostListAdapter;->TAG:Ljava/lang/String;

    .line 77
    const/16 v0, 0xa

    new-array v0, v0, [Ljava/lang/String;

    const/4 v1, 0x0

    .line 78
    const-string v2, "_id"

    aput-object v2, v0, v1

    const/4 v1, 0x1

    const-string v2, "id"

    aput-object v2, v0, v1

    const/4 v1, 0x2

    const-string v2, "title"

    aput-object v2, v0, v1

    const/4 v1, 0x3

    .line 79
    const-string v2, "date"

    aput-object v2, v0, v1

    const-string v1, "content"

    aput-object v1, v0, v3

    const/4 v1, 0x5

    const-string v2, "categories"

    aput-object v2, v0, v1

    const/4 v1, 0x6

    .line 80
    const-string v2, "commentscount"

    aput-object v2, v0, v1

    const/4 v1, 0x7

    const-string v2, "imageurl"

    aput-object v2, v0, v1

    const/16 v1, 0x8

    const-string v2, "post_order"

    aput-object v2, v0, v1

    const/16 v1, 0x9

    .line 81
    const-string v2, "opened"

    aput-object v2, v0, v1

    .line 77
    sput-object v0, Lcom/opongo/blogapp/adapter/PostListAdapter;->POSTCOLUMNS:[Ljava/lang/String;

    .line 83
    new-array v0, v3, [I

    fill-array-data v0, :array_0

    sput-object v0, Lcom/opongo/blogapp/adapter/PostListAdapter;->IDS:[I

    .line 41
    return-void

    .line 83
    :array_0
    .array-data 0x4
        0x25t 0x0t 0x8t 0x7ft
        0x29t 0x0t 0x8t 0x7ft
        0x2bt 0x0t 0x8t 0x7ft
        0x2at 0x0t 0x8t 0x7ft
    .end array-data
.end method

.method public constructor <init>(Landroid/app/Activity;Landroid/content/Context;ILandroid/database/Cursor;Ljava/lang/String;)V
    .locals 6
    .parameter "activity"
    .parameter "context"
    .parameter "layoutId"
    .parameter "cursor"
    .parameter "tablename"

    .prologue
    .line 133
    sget-object v4, Lcom/opongo/blogapp/adapter/PostListAdapter;->POSTCOLUMNS:[Ljava/lang/String;

    sget-object v5, Lcom/opongo/blogapp/adapter/PostListAdapter;->IDS:[I

    move-object v0, p0

    move-object v1, p2

    move v2, p3

    move-object v3, p4

    invoke-direct/range {v0 .. v5}, Landroid/widget/SimpleCursorAdapter;-><init>(Landroid/content/Context;ILandroid/database/Cursor;[Ljava/lang/String;[I)V

    .line 68
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->isLockLoading:Z

    .line 69
    const/4 v0, 0x1

    iput v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->page:I

    .line 136
    invoke-static {p2}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    iput-object v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->mInflater:Landroid/view/LayoutInflater;

    .line 137
    iput p3, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->layoutId:I

    .line 139
    new-instance v0, Ljava/text/SimpleDateFormat;

    const-string v1, "yyyy-MM-dd HH:mm:ss"

    invoke-direct {v0, v1}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V

    iput-object v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->df:Ljava/text/DateFormat;

    .line 140
    new-instance v0, Lcom/ocpsoft/pretty/time/PrettyTime;

    new-instance v1, Ljava/util/Locale;

    const-string v2, "de"

    invoke-direct {v1, v2}, Ljava/util/Locale;-><init>(Ljava/lang/String;)V

    invoke-direct {v0, v1}, Lcom/ocpsoft/pretty/time/PrettyTime;-><init>(Ljava/util/Locale;)V

    iput-object v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->pTime:Lcom/ocpsoft/pretty/time/PrettyTime;

    .line 142
    iput-object p1, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->activity:Landroid/app/Activity;

    .line 144
    iput-object p5, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->tablename:Ljava/lang/String;

    .line 150
    const-string v0, "id"

    invoke-interface {p4, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->idIndex:I

    .line 151
    const-string v0, "title"

    invoke-interface {p4, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->titleIndex:I

    .line 152
    const-string v0, "date"

    invoke-interface {p4, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->dateIndex:I

    .line 153
    const-string v0, "categories"

    invoke-interface {p4, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->categoriesIndex:I

    .line 154
    const-string v0, "commentscount"

    invoke-interface {p4, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->commentscountIndex:I

    .line 155
    const-string v0, "imageurl"

    invoke-interface {p4, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->imageurlIndex:I

    .line 156
    const-string v0, "opened"

    invoke-interface {p4, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->opened:I

    .line 158
    new-instance v0, Lcom/opongo/blogapp/manager/ImageManager;

    invoke-direct {v0, p2}, Lcom/opongo/blogapp/manager/ImageManager;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->imageManager:Lcom/opongo/blogapp/manager/ImageManager;

    .line 159
    return-void
.end method

.method static synthetic access$0()Ljava/lang/String;
    .locals 1

    .prologue
    .line 45
    sget-object v0, Lcom/opongo/blogapp/adapter/PostListAdapter;->TAG:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$1(Lcom/opongo/blogapp/adapter/PostListAdapter;)Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 70
    iget-object v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->tablename:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$2(Lcom/opongo/blogapp/adapter/PostListAdapter;)Landroid/app/Activity;
    .locals 1
    .parameter

    .prologue
    .line 63
    iget-object v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->activity:Landroid/app/Activity;

    return-object v0
.end method


# virtual methods
.method public bindView(Landroid/view/View;Landroid/content/Context;Landroid/database/Cursor;)V
    .locals 11
    .parameter "view"
    .parameter "context"
    .parameter "cursor"

    .prologue
    const v10, 0x7f020018

    const/4 v9, 0x0

    .line 212
    invoke-virtual {p1}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;

    .line 215
    .local v5, viewHolder:Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;
    const/4 v1, 0x0

    .line 217
    .local v1, date:Ljava/util/Date;
    :try_start_0
    iget-object v6, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->df:Ljava/text/DateFormat;

    iget v7, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->dateIndex:I

    invoke-interface {p3, v7}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/text/DateFormat;->parse(Ljava/lang/String;)Ljava/util/Date;
    :try_end_0
    .catch Ljava/text/ParseException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    .line 223
    :goto_0
    iget v6, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->categoriesIndex:I

    invoke-interface {p3, v6}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    .line 226
    .local v0, categories:Ljava/lang/String;
    #getter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mTitleText:Landroid/widget/TextView;
    invoke-static {v5}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$4(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;)Landroid/widget/TextView;

    move-result-object v6

    iget v7, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->titleIndex:I

    invoke-interface {p3, v7}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 228
    const-string v6, ""

    invoke-virtual {v0, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-nez v6, :cond_1

    .line 229
    #getter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mDetailText:Landroid/widget/TextView;
    invoke-static {v5}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$5(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;)Landroid/widget/TextView;

    move-result-object v6

    new-instance v7, Ljava/lang/StringBuilder;

    iget-object v8, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->pTime:Lcom/ocpsoft/pretty/time/PrettyTime;

    invoke-virtual {v8, v1}, Lcom/ocpsoft/pretty/time/PrettyTime;->format(Ljava/util/Date;)Ljava/lang/String;

    move-result-object v8

    invoke-static {v8}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v8

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v8, " in "

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    const/16 v8, 0x46

    invoke-static {v7, v8}, Lcom/opongo/blogapp/utils/StringUtils;->crop(Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 235
    :goto_1
    #getter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mCommentsCount:Landroid/widget/TextView;
    invoke-static {v5}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$6(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;)Landroid/widget/TextView;

    move-result-object v6

    iget v7, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->commentscountIndex:I

    invoke-interface {p3, v7}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 238
    #getter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mCommentsCount:Landroid/widget/TextView;
    invoke-static {v5}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$6(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;)Landroid/widget/TextView;

    move-result-object v6

    iget v7, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->idIndex:I

    invoke-interface {p3, v7}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Landroid/widget/TextView;->setTag(Ljava/lang/Object;)V

    .line 239
    #getter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mCommentsCount:Landroid/widget/TextView;
    invoke-static {v5}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$6(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;)Landroid/widget/TextView;

    move-result-object v6

    new-instance v7, Lcom/opongo/blogapp/adapter/PostListAdapter$1;

    invoke-direct {v7, p0}, Lcom/opongo/blogapp/adapter/PostListAdapter$1;-><init>(Lcom/opongo/blogapp/adapter/PostListAdapter;)V

    invoke-virtual {v6, v7}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 253
    iget v6, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->imageurlIndex:I

    invoke-interface {p3, v6}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v3

    .line 254
    .local v3, imgUrl:Ljava/lang/String;
    #getter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mThumbImg:Landroid/widget/ImageView;
    invoke-static {v5}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$7(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;)Landroid/widget/ImageView;

    move-result-object v6

    if-eqz v6, :cond_4

    .line 255
    invoke-virtual {v3}, Ljava/lang/String;->length()I

    move-result v6

    const/16 v7, 0xa

    if-le v6, v7, :cond_2

    .line 256
    #getter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mThumbImg:Landroid/widget/ImageView;
    invoke-static {v5}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$7(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;)Landroid/widget/ImageView;

    move-result-object v6

    invoke-virtual {v6, v10}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 257
    iget-object v6, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->imageManager:Lcom/opongo/blogapp/manager/ImageManager;

    iget-object v7, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->activity:Landroid/app/Activity;

    #getter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mThumbImg:Landroid/widget/ImageView;
    invoke-static {v5}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$7(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;)Landroid/widget/ImageView;

    move-result-object v8

    invoke-virtual {v6, v3, v7, v8}, Lcom/opongo/blogapp/manager/ImageManager;->displayImage(Ljava/lang/String;Landroid/app/Activity;Landroid/widget/ImageView;)V

    .line 267
    :cond_0
    :goto_2
    iget v6, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->opened:I

    invoke-interface {p3, v6}, Landroid/database/Cursor;->getInt(I)I

    move-result v4

    .line 269
    .local v4, isOpened:I
    const/4 v6, 0x1

    if-ne v4, v6, :cond_5

    .line 270
    #getter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mTitleText:Landroid/widget/TextView;
    invoke-static {v5}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$4(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;)Landroid/widget/TextView;

    move-result-object v6

    const/16 v7, 0x40

    invoke-static {v7, v9, v9, v9}, Landroid/graphics/Color;->argb(IIII)I

    move-result v7

    invoke-virtual {v6, v7}, Landroid/widget/TextView;->setTextColor(I)V

    .line 274
    :goto_3
    return-void

    .line 218
    .end local v0           #categories:Ljava/lang/String;
    .end local v3           #imgUrl:Ljava/lang/String;
    .end local v4           #isOpened:I
    :catch_0
    move-exception v2

    .line 219
    .local v2, e:Ljava/text/ParseException;
    invoke-virtual {v2}, Ljava/text/ParseException;->printStackTrace()V

    goto/16 :goto_0

    .line 231
    .end local v2           #e:Ljava/text/ParseException;
    .restart local v0       #categories:Ljava/lang/String;
    :cond_1
    #getter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mDetailText:Landroid/widget/TextView;
    invoke-static {v5}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$5(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;)Landroid/widget/TextView;

    move-result-object v6

    iget-object v7, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->pTime:Lcom/ocpsoft/pretty/time/PrettyTime;

    invoke-virtual {v7, v1}, Lcom/ocpsoft/pretty/time/PrettyTime;->format(Ljava/util/Date;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_1

    .line 259
    .restart local v3       #imgUrl:Ljava/lang/String;
    :cond_2
    sget-boolean v6, Lcom/opongo/blogapp/adapter/PostListAdapter;->DEBUG:Z

    if-eqz v6, :cond_3

    sget-object v6, Lcom/opongo/blogapp/adapter/PostListAdapter;->TAG:Ljava/lang/String;

    new-instance v7, Ljava/lang/StringBuilder;

    const-string v8, "Image url to short to be valid: "

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v7, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-static {v6, v7}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 260
    :cond_3
    #getter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mThumbImg:Landroid/widget/ImageView;
    invoke-static {v5}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$7(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;)Landroid/widget/ImageView;

    move-result-object v6

    invoke-virtual {v6, v10}, Landroid/widget/ImageView;->setImageResource(I)V

    goto :goto_2

    .line 263
    :cond_4
    #getter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mThumbImg:Landroid/widget/ImageView;
    invoke-static {v5}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$7(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;)Landroid/widget/ImageView;

    move-result-object v6

    invoke-virtual {v6, v10}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 264
    sget-boolean v6, Lcom/opongo/blogapp/adapter/PostListAdapter;->DEBUG:Z

    if-eqz v6, :cond_0

    sget-object v6, Lcom/opongo/blogapp/adapter/PostListAdapter;->TAG:Ljava/lang/String;

    const-string v7, "Thumbnail holder is null!"

    invoke-static {v6, v7}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_2

    .line 272
    .restart local v4       #isOpened:I
    :cond_5
    #getter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mTitleText:Landroid/widget/TextView;
    invoke-static {v5}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$4(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;)Landroid/widget/TextView;

    move-result-object v6

    const/16 v7, 0xff

    invoke-static {v7, v9, v9, v9}, Landroid/graphics/Color;->argb(IIII)I

    move-result v7

    invoke-virtual {v6, v7}, Landroid/widget/TextView;->setTextColor(I)V

    goto :goto_3
.end method

.method public newView(Landroid/content/Context;Landroid/database/Cursor;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 5
    .parameter "context"
    .parameter "cursor"
    .parameter "parent"

    .prologue
    .line 183
    iget-object v2, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->mInflater:Landroid/view/LayoutInflater;

    iget v3, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->layoutId:I

    .line 184
    const/4 v4, 0x0

    .line 183
    invoke-virtual {v2, v3, p3, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v0

    .line 187
    .local v0, view:Landroid/view/View;
    new-instance v1, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;

    invoke-direct {v1}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;-><init>()V

    .line 192
    .local v1, viewHolder:Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;
    const v2, 0x7f080025

    invoke-virtual {v0, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/ImageView;

    #setter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mThumbImg:Landroid/widget/ImageView;
    invoke-static {v1, v2}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$0(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;Landroid/widget/ImageView;)V

    .line 193
    const v2, 0x7f080029

    invoke-virtual {v0, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    #setter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mTitleText:Landroid/widget/TextView;
    invoke-static {v1, v2}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$1(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;Landroid/widget/TextView;)V

    .line 194
    const v2, 0x7f08002b

    invoke-virtual {v0, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    #setter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mDetailText:Landroid/widget/TextView;
    invoke-static {v1, v2}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$2(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;Landroid/widget/TextView;)V

    .line 195
    const v2, 0x7f08002a

    invoke-virtual {v0, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    #setter for: Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->mCommentsCount:Landroid/widget/TextView;
    invoke-static {v1, v2}, Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;->access$3(Lcom/opongo/blogapp/adapter/PostListAdapter$ViewHolder;Landroid/widget/TextView;)V

    .line 198
    invoke-virtual {v0, v1}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 200
    return-object v0
.end method

.method public removeListViewFooter()V
    .locals 2

    .prologue
    .line 105
    iget-object v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->listView:Landroid/widget/ListView;

    if-eqz v0, :cond_0

    .line 106
    iget-object v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->listView:Landroid/widget/ListView;

    iget-object v1, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->footerView:Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->removeFooterView(Landroid/view/View;)Z

    .line 107
    :cond_0
    return-void
.end method

.method public removeListViewHeader()V
    .locals 3

    .prologue
    .line 124
    :try_start_0
    iget-object v1, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->listView:Landroid/widget/ListView;

    iget-object v2, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->headerView:Landroid/view/View;

    invoke-virtual {v1, v2}, Landroid/widget/ListView;->removeHeaderView(Landroid/view/View;)Z
    :try_end_0
    .catch Ljava/lang/NullPointerException; {:try_start_0 .. :try_end_0} :catch_0

    .line 129
    :goto_0
    return-void

    .line 125
    :catch_0
    move-exception v0

    .line 127
    .local v0, e:Ljava/lang/NullPointerException;
    invoke-virtual {v0}, Ljava/lang/NullPointerException;->printStackTrace()V

    goto :goto_0
.end method

.method public setListViewFooter(Landroid/view/View;Landroid/widget/ListView;)V
    .locals 4
    .parameter "footerView"
    .parameter "listView"

    .prologue
    .line 87
    if-eqz p2, :cond_0

    .line 88
    iput-object p2, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->listView:Landroid/widget/ListView;

    .line 90
    :cond_0
    iget-object v1, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->footerView:Landroid/view/View;

    if-eqz v1, :cond_1

    .line 91
    invoke-virtual {p0}, Lcom/opongo/blogapp/adapter/PostListAdapter;->removeListViewFooter()V

    .line 93
    :cond_1
    iput-object p1, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->footerView:Landroid/view/View;

    .line 96
    :try_start_0
    iget-object v1, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->listView:Landroid/widget/ListView;

    invoke-virtual {v1, p1}, Landroid/widget/ListView;->addFooterView(Landroid/view/View;)V
    :try_end_0
    .catch Ljava/lang/NullPointerException; {:try_start_0 .. :try_end_0} :catch_0

    .line 102
    :goto_0
    return-void

    .line 97
    :catch_0
    move-exception v0

    .line 99
    .local v0, e:Ljava/lang/NullPointerException;
    sget-object v1, Lcom/opongo/blogapp/adapter/PostListAdapter;->TAG:Ljava/lang/String;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Add footer exception: "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/lang/NullPointerException;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method

.method public setListViewHeader(Landroid/view/View;Landroid/widget/ListView;)V
    .locals 1
    .parameter "headerView"
    .parameter "listView"

    .prologue
    .line 110
    if-eqz p2, :cond_0

    .line 111
    iput-object p2, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->listView:Landroid/widget/ListView;

    .line 113
    :cond_0
    iget-object v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->headerView:Landroid/view/View;

    if-eqz v0, :cond_1

    .line 114
    invoke-virtual {p0}, Lcom/opongo/blogapp/adapter/PostListAdapter;->removeListViewHeader()V

    .line 116
    :cond_1
    iput-object p1, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->headerView:Landroid/view/View;

    .line 118
    if-eqz p1, :cond_2

    .line 119
    iget-object v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->listView:Landroid/widget/ListView;

    invoke-virtual {v0, p1}, Landroid/widget/ListView;->addHeaderView(Landroid/view/View;)V

    .line 120
    :cond_2
    return-void
.end method

.method public stopImgLoaderThread()V
    .locals 1

    .prologue
    .line 277
    iget-object v0, p0, Lcom/opongo/blogapp/adapter/PostListAdapter;->imageManager:Lcom/opongo/blogapp/manager/ImageManager;

    invoke-virtual {v0}, Lcom/opongo/blogapp/manager/ImageManager;->stopThread()V

    .line 278
    return-void
.end method
